/****************************************************************************

Force Engine v0.5

Creado: 28/03/08
Clase: Light.cpp
Hecho by: German Battiston AKA Melkor

****************************************************************************/

//---------------------------------------------------------------------------
#include "Light.h"
//---------------------------------------------------------------------------
Light::Light()
{

}
//---------------------------------------------------------------------------
Light::~Light()
{

}
//---------------------------------------------------------------------------
void Light::SetAmbient(DWORD color)
{
	m_kDxLight.Ambient.a =  ((float)((color  & ALPHA)	>> 24)) / 255;
	m_kDxLight.Ambient.r =  ((float)((color  & RED)	>> 16)) / 255;
	m_kDxLight.Ambient.g =  ((float)((color  & GREEN)	>> 8))  / 255;
	m_kDxLight.Ambient.b =  ((float)((color  & BLUE)	>> 0))  / 255;
}
//---------------------------------------------------------------------------
void Light::SetDiffuse(DWORD color)
{
	m_kDxLight.Diffuse.a =  ((float)((color  & ALPHA)	>> 24)) / 255;
	m_kDxLight.Diffuse.r =  ((float)((color  & RED)	>> 16)) / 255;
	m_kDxLight.Diffuse.g =  ((float)((color  & GREEN)	>> 8))  / 255;
	m_kDxLight.Diffuse.b =  ((float)((color  & BLUE)	>> 0))  / 255;
}
//---------------------------------------------------------------------------
void Light::SetSpecular(DWORD color)
{
	m_kDxLight.Specular.a = ((float)((color & ALPHA)	>> 24)) / 255;
	m_kDxLight.Specular.r = ((float)((color & RED)	>> 16)) / 255;
	m_kDxLight.Specular.g = ((float)((color & GREEN)	>> 8))  / 255;
	m_kDxLight.Specular.b = ((float)((color & BLUE)	>> 0))  / 255;
}
//---------------------------------------------------------------------------
void Light::SetPos(D3DXVECTOR3 vPos)
{
	m_kDxLight.Position.x = vPos.x;
	m_kDxLight.Position.y = vPos.y;
	m_kDxLight.Position.z = vPos.z;
}
//---------------------------------------------------------------------------
void Light::SetDirection(D3DXVECTOR3 vDir)
{
	m_kDxLight.Direction.x = vDir.x;
	m_kDxLight.Direction.y = vDir.y;
	m_kDxLight.Direction.z = vDir.z;
}
//---------------------------------------------------------------------------
D3DXVECTOR3 Light::GetPos()
{
	return m_kDxLight.Direction;
}
//---------------------------------------------------------------------------
D3DXVECTOR3 Light::GetDirection()
{
	return m_kDxLight.Position;
}
//---------------------------------------------------------------------------